﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//Author: ljj
//Date: 20190709
//Function: 灼伤debuff 每秒扣effect血
public class Burn : BaseBuff
{
    public override void BuffUp()
    {
        //Debug.Log("Burn BuffUp" + effect);
        BodyColor body = gameObject.GetComponentInChildren<BodyColor>();
        if (body != null)
            body.AddColor(new Color(251f / 255f, 56f / 255f, 56f / 255f));
    }

    public override void BuffDown()
    {
        //Debug.Log("Burn BuffDown" + effect);
        BodyColor body = gameObject.GetComponentInChildren<BodyColor>();
        if (body != null)
            body.ReplaceColor(new Color(1f, 1f, 1f));
    }


    public override void Continued(float delta)
    {
        BattleObject bt = gameObject.GetComponent<BattleObject>();
        if (bt != null)
        {
            bt.attacked(delta * effect);
        }
    }
}
